#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void Pink_Lady(int arr[], int sz)
{
	int i = 0;
	int count = 0;
	for (i = 0; i < sz / 2; i++)
	{
		int tmp = 0;
		int j = 0;
		for (j = 0; j < sz - i - 1; j++)
		{
			if (arr[j] > arr[j + 1])
			{

			tmp = arr[j];
			arr[j] = arr[j + 1];
			arr[j + 1] = tmp;
			count++;
			}

		}
		if (count == 0)
		{
			break;
		}
		count = 0;
		for (j; j > i; j--)
		{
			if (arr[j] < arr[j - 1])
			{
				tmp = arr[j - 1];
				arr[j - 1] = arr[j];
				arr[j] = tmp;
				count++;
			}
		}
		if (count == 0)
		{
			break;
		}
	}
}



int main()
{
	int arr[] = { 8,5,4,7,6,3,1,2,9,10,11,12,13 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	Pink_Lady(arr, sz);
	int i = 0;
	for (i = 0; i < sz; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}